(function(){
	
	if (!window.CJ) {
		window.CJ = {};
	}

	function Promotion () {
		this.name = 'Promotion';
		this.bindEvent();
	}
	
	Promotion.prototype = new EventCtl();
	Promotion.prototype.bindEvent = function () {
		$('#global .event').on('click', function() {
			CJ.Scene.promotionDetail();
		});
		$('#global .event').on('mouseenter', function() {
			if(!CJ.isRightDetailEntry) {
				$('#global li').removeClass('focus');
				$('#global .event').addClass('focus');
				CJ.Scene.setDelegate(CJ.Scene["Promotion"]);
			}
		});
	};
	Promotion.prototype.down = function () {
		CJ.Scene.banner();
	};
	Promotion.prototype.left = function () {
		CJ.Scene.search();
	};
	Promotion.prototype.right = function () {
	};
	Promotion.prototype.back = function () {
		$('#global li').removeClass('focus');
		$("#event").hide();
		$("#mask").hide();
		CJ.Scene.channel();
	};
	Promotion.prototype.enter = function () {
		CJ.Scene.promotionDetail();
	};
	
	function PromotionDetail () {
		this.name = 'PromotionDetail';
		this.bindEvent();
	}
	
	PromotionDetail.prototype = new EventCtl();
	PromotionDetail.prototype.bindEvent = function () {
	};
	PromotionDetail.prototype.left = function () {
	};
	PromotionDetail.prototype.right = function () {
	};
	PromotionDetail.prototype.back = function () {
		CJ.Scene.promotion();
	};
	PromotionDetail.prototype.enter = function () {
	};

	$.extend(CJ.Scene, {
							promotion: function(){
								CJ.isRightDetailEntry = false;
								$("#wrap").removeClass().addClass('ch');//vod 화면 전환
								$('#global li').removeClass('focus');
								$('#global .event').addClass('focus');
								$("#event").hide();
								$("#mask").hide();
								this.setDelegate(this["Promotion"]);
							},
							promotionDetail: function(){
								CJ.isRightDetailEntry = true;
								$("#wrap").removeClass().addClass('ch');//vod 화면 전환
								$('#global li').removeClass('focus');
								$("#event").show();
								$("#mask").show();
								this.setDelegate(this["PromotionDetail"]);
							}
						});

	$(document).ready(function(){
		CJ.Scene["Promotion"] = new Promotion();
		CJ.Scene["PromotionDetail"] = new PromotionDetail();
	});

})();